/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package engine.game;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

/**
 *
 * @author NathanT
 */
public class GlobalKeyListener implements KeyListener {

    private Game game;
    
    public GlobalKeyListener() {
        this.game = Game.getGlobalGame();
    }
    
    @Override
    public void keyTyped(KeyEvent e) {
        
    }

    @Override
    public void keyPressed(KeyEvent e) {
        int code = e.getKeyCode();
        if (code == KeyEvent.VK_I) {
            if (!game.getActivePlayer().isInCombat()) {
                game.toggleInventory();
            }
        }
    }

    @Override
    public void keyReleased(KeyEvent e) {
        
    }
    
}
